﻿using System.Net;
using System.Net.Sockets;
using Fvs_Service.Net;

namespace Fvs_Service
{
    public class VirtualLampHandler:ISocketHandler
    {
        public SocketPack Unpack(Socket socket, IPEndPoint remoteEndPoint, List<byte> buffer, int offset)
        {
            if (buffer[0] == 0x81)
            {
                return new SocketPack
                {
                    Result = AnalysisResult.Full,
                    Offset = 0,
                    Size = buffer.Count,
                    ProtocolId = buffer[2],
                    TimeStamp = 0
                };
            }

            else
            {
                return new SocketPack
                {
                    Result = AnalysisResult.Empty,
                    Offset = 0,
                    Size = buffer.Count,
                    ProtocolId = 0,
                    TimeStamp = 0
                };
            }

        }

      
    }
}
